<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib tagdir="/WEB-INF/tags" prefix="tags"%>

<fmt:message key="login.title" var="title"/>
<center>
<tags:post title="${title}" width="60%">
<c:url value="j_spring_security_check" var="url"/>
<form id="loginForm" method="POST" action="${url}">
<table cellspacing="0">
  <tr class="p">
    <td colspan="3">
      <c:choose>
        <c:when test="${param.error}">
          <div id="error">
            <c:url value="/styles/default/images/security_error.png" var="src"/>
            <img src="${src}" alt="Error" style="float:left;"/>
            <fmt:message key="login.error">
              <fmt:param value="${sessionScope.SPRING_SECURITY_LAST_EXCEPTION.message}"/>
            </fmt:message>
          </div>
        </c:when>
        <c:otherwise>
          <div id="note">
            <c:url value="/styles/default/images/security_login.png" var="src"/>
            <img src="${src}" alt="Login" style="float:left;"/>
            <fmt:message key="login.note"/>
          </div>
        </c:otherwise>
      </c:choose>
      <br/><br/>
    </td>
  </tr><tr>
    <td><input type="text" class="input" name="j_username" size="24"></td>
    <td><input type="password" class="input" name="j_password" size="24"></td>
    <td>
      <fmt:message key="menu.login" var="submit"/>
      <input type="submit" value="${submit}" id="submit"/>
    </td>
  </tr><tr>
    <td><label for="j_username"><fmt:message key="user.name"/></label></td>
    <td><label for="j_password"><fmt:message key="user.passwd"/></label></td>
    <td>&nbsp;</td>
  </tr><tr class="p">
    <td colspan="3">
      <input type='checkbox' name='_spring_security_remember_me'/>
      <label for="_spring_security_remember_me"><fmt:message key="login.remember"/></label>
    </td>
  </tr>
</table>
</form>
</tags:post>
</center>
